import React, { useState } from 'react'
import './register.less'
import Reg1 from './reg1'
import Reg2 from './reg2'
import RegLog from './regLog'
export default function Register(props) {
    const [Pagfalg, setPagfalg] = useState(0)
    const [telNum, setTelnum] = useState('') //手机号
    return (
        <div className='Register'>
            <header className='RegisterTop' onClick={() => {
                props.history.go(-1)
            }}>
                <svg className="icon" aria-hidden="true">
                    <use xlinkHref="#icon-zuojiantou"></use>
                </svg>
            </header>
            <main>
                {/* <Reg1 /> */}
                {
                    Pagfalg === 0 ? <Reg1 setFlag={setPagfalg} setTelnum={setTelnum} /> : (Pagfalg === 1 ? <Reg2 setFlag={setPagfalg} /> : <RegLog setFlag={setPagfalg} telNum={telNum} />)
                }
            </main>
            <footer>
                <span>
                    找回密码
                </span>
                <i>|</i>
                <span>
                    紧急冻结
                </span>
                <i>|</i>
                <span>
                    微信安全中心
                </span>
            </footer>
        </div>
    )
}
